Fk:loadTranslationTable{
  ["emo__paoxiao"] = "咆哮",
  [":emo__paoxiao"] = "锁定技，你使用的【酒】额外结算一次，【杀】无次数限制，被抵消过的回合内：上述两牌名的位置互换，且你的锦囊牌视为【酒】。",

  [":emo__paoxiao_inner"] = "锁定技，你使用的【杀】额外结算一次，【酒】无次数限制，本回合你的锦囊牌视为【酒】。",
  ["@@emo__paoxiao-turn"] = "咆哮",

  ["$emo__paoxiao1"] = "喝啊！",
  ["$emo__paoxiao2"] = "今，必斩汝马下！",
  ["$emo__paoxiao3"] = "战又不战，退又不退，却是何故！",
}

local skel = fk.CreateSkill{
  name = "emo__paoxiao",
  tags = { Skill.Compulsory },
  dynamic_desc = function (self, player, lang)
    if player:getMark("@@emo__paoxiao-turn") ~= 0 then
      return "emo__paoxiao_inner"
    end
  end,
}

skel:addEffect(fk.CardUsing, { -- 额外结算1次
  audio_index = {1, 2},
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(skel.name) then
      if player:getMark("@@emo__paoxiao-turn") == 0 then
        return data.card.trueName == "analeptic"
      else
        return data.card.trueName == "slash"
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    data.additionalEffect = (data.additionalEffect or 0) + 1
  end,
})

skel:addEffect("targetmod", { -- 无次数限制
  bypass_times = function(self, player, skill, scope, card)
    if player:hasSkill(skel.name) and card then
      if player:getMark("@@emo__paoxiao-turn") == 0 then
        return card.trueName == "slash"
      else
        return card.trueName == "analeptic"
      end
    end
  end,
})

skel:addEffect(fk.PreCardUse, { -- 不计入次数
  can_refresh = function(self, event, target, player, data)
    if target == player and player:hasSkill(skel.name) then
      if player:getMark("@@emo__paoxiao-turn") == 0 then
        return data.card.trueName == "slash"
      else
        return data.card.trueName == "analeptic"
      end
    end
  end,
  on_refresh = function(self, event, target, player, data)
    player:broadcastSkillInvoke(skel.name, math.random(2))
    --player.room:notifySkillInvoked(player, skel.name, "offensive")
    data.extraUse = true
  end,
})

skel:addEffect(fk.CardEffectCancelledOut, { -- 被抵消切换形态
  audio_index = 3,
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player == target and data.card.trueName == "slash" and player:hasSkill(skel.name)
    and player:getMark("@@emo__paoxiao-turn") == 0
  end,
  on_use = function(self, event, target, player, data)
    player.room:setPlayerMark(player, "@@emo__paoxiao-turn", 1)
  end,
})

skel:addEffect("filter", { -- 锦囊视为酒
  mute = true,
  card_filter = function(self, card, player)
    return player:hasSkill(skel.name) and card.type == Card.TypeTrick and
      table.contains(player:getCardIds("h"), card.id) and player:getMark("@@emo__paoxiao-turn") ~= 0
  end,
  view_as = function(self, player, card)
    local c = Fk:cloneCard("analeptic", card.suit, card.number)
    c.skillName = skel.name
    return c
  end,
})

return skel
